package com.play.springflux.util;

import com.play.springflux.exception.CheckException;

import java.util.Arrays;

public class CheckUtil {

    public static final String[] NotAllowedNAMES = {"admin", "sec_admin", "test"};

    public static void checkName(String name) {
        Arrays.stream(NotAllowedNAMES).filter(e -> e.equalsIgnoreCase(name)).findAny().ifPresent(v -> {
            throw new CheckException("name", "not allowed");
        });
    }
}
